package cn.wolfcode.luowowo.service.impl;

import cn.wolfcode.luowowo.article.domain.Tourist;
import cn.wolfcode.luowowo.article.mapper.TouristMapper;
import cn.wolfcode.luowowo.article.query.TouristQuery;
import cn.wolfcode.luowowo.article.service.ITouristService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class TouristServiceImpl implements ITouristService {

    @Autowired
    private TouristMapper touristMapper;

    @Override
    public List<Tourist> listForList(TouristQuery qo) {
//        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
//        return new PageInfo(touristMapper.selectForList(qo));
        return touristMapper.selectForList(qo);
    }

    @Override
    public List<Tourist> listByDestIdAndSubjectId(Long DestId, Long SubjectId) {
        return touristMapper.selectByDestIdAndSubjectId(DestId,SubjectId);
    }

    @Override
    public List<Tourist> listByDestId(Long ajaxDestId) {
        List<Tourist> list = touristMapper.selectByDestId(ajaxDestId);
        return list;
    }

    @Override
    public Tourist listByTouristId(Long tid) {
        return touristMapper.selectByTouristId(tid);
    }
}
